//
//  BaseHomeCollectionViewCell.swift
//  DouYuZB
//
//  Created by 中创 on 2020/4/23.
//  Copyright © 2020 梁森. All rights reserved.
//

import UIKit

class BaseHomeCollectionViewCell: BaseCollectionViewCell {
    @IBOutlet weak var contentPicture: UIImageView!
    @IBOutlet weak var onlineBtn: UIButton!
    @IBOutlet weak var titleLbl: UILabel!
    @IBOutlet weak var cityBtn: UIButton!
    
    var room:AnchorModel?{
           didSet{
               guard let room:AnchorModel = room else {return}
               titleLbl.text = room.nickname
               var onlineStr:String = ""
               if room.online >= 10000 {
                   onlineStr = "\(Int(room.online / 10000))万在线"
               }else{
                   onlineStr = "\(room.online)在线"
               }
               onlineBtn.setTitle(onlineStr, for: .normal)
               let url = URL(string:room.room_src)
                contentPicture.lsSetImage(string: room.room_src)
           }
       }
}
